<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    {include file="common/cssInfo" /}

    <title>列表页</title>

</head>

<body>
    <header>
        {include file="common/nav" /}
    </header>
    <div class="main-container container-fluid">
        <div class="page-container">
            <!-- 侧边栏 -->
            {include file="common/sidebar" /}
            <!-- Page Content -->
            <div class="page-content">
                <!-- Page Breadcrumb -->
                <div class="page-breadcrumbs">
                    <ul class="breadcrumb">
                        <li>
                            <a href="#">系统</a>
                        </li>
                        <li>
                            <a href="{:url('lst')}">文章</a>
                        </li>
                        <li class="active">{$catename.catename}</li>
                    </ul>
                </div>
                <!-- /Page Breadcrumb -->

                <!-- Page Body -->
                <div class="page-body">
                    <a href="{:url('add',array('cateid'=>$catename.id))}">
                        <button type="button" tooltip="添加文章" class="btn btn-sm btn-azure btn-addon">
                            <i class="fa fa-plus"></i> Add
                        </button>
                    </a>
                    <div class="row">
                        <div class="col-lg-12 col-sm-12 col-xs-12">
                            <div class="widget">
                                <div class="widget-body">
                                    <div class="flip-scroll">
                                        <table class="table table-bordered table-hover">
                                            <thead class="">
                                                <tr>
                                                    <th class="text-center">ID</th>
                                                    <th class="text-center">标题</th>
                                                    <th class="text-center">缩略图</th>
                                                    <th class="text-center">作者</th>
                                                    <th class="text-center">所属栏目</th>
                                                    <th class="text-center">操作</th>
                                                </tr>
                                            </thead>
                                            <tbody>
                                                {volist name="articleres" id="article"}
                                                <tr>
                                                    <td align="center">{$article.id}</td>
                                                    <td align="center">
                                                        <?php 
                                                            echo mb_substr($article['title'],0,6,'utf-8');
                                                            if(strlen($article['title']>6)){
                                                                echo '...';
                                                            } 
                                                        ?>
                                                    </td>
                                                    <td align="center">
                                                        {if condition="$article['thumb'] != ''"}
                                                        <img src="{$article.thumb}" height="30px" alt="">
                                                        {else /}
                                                        暂无缩略图
                                                        {/if}
                                                    </td>
                                                    <td align="center">{$article.author}</td>
                                                    <td align="center">{$catename.catename}</td>
                                                    <td align="center">
                                                        <a href="{:url('edit',array('id'=>$article.id))}" class="btn btn-primary btn-sm shiny">
                                                            <i class="fa fa-edit"></i> 编辑
                                                        </a>
                                                        <a href="#" onClick="warning('确实要删除吗', '{:url('del',array('id'=>$article.id))}')"
                                                            class="btn btn-danger btn-sm shiny">
                                                            <i class="fa fa-trash-o"></i> 删除
                                                        </a>
                                                    </td>
                                                </tr>
                                                {/volist}
                                            </tbody>
                                        </table>
                                    </div>
                                    <div style="margin-top:20px;">
                                        {$page}
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>

                </div>
                <!-- /Page Body -->
            </div>
            <!-- /Page Content -->
        </div>
    </div>

    <!-- 引入js -->
    {include file="common/jsInfo" /}
</body>

</html>